serial="$2"
shift
;;
+ -monitor)
+ monitor="$2"
+ shift
+ ;;
esac
fi
case "$1" in
vncpasswd=`xenstore-read /local/domain/0/backend/vfb/$domid/0/vncpasswd 2>/dev/null`
test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd"
test "$keymap" && vfb="$vfb, keymap=$keymap"
+test "$monitor" && vfb="$vfb, monitor=$monitor"
test "$serial" && vfb="$vfb, serial=$serial"
echo "vfb = ['$vfb']" >> /etc/xen/stubdoms/$domname-dm
del dev_info['type']
log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
(dev_type, vfb_type))
+ # Create serial backends now, the location value is bogus, but does not matter
+ i=0
+ chardev=0
if dev_info.get('serial') is not None :
- # Create two serial backends now, the location value is bogus, but does not matter
- cfg = self.console_add('vt100', '0')
+ chardev = chardev + 1
+ if dev_info.get('monitor') is not None :
+ chardev = chardev + 1
+ if chardev > 0 :
+ chardev = chardev + 1
+ while i < chardev :
+ cfg = self.console_add('vt100', str(i))
c_uuid = uuid.createString()
target['devices'][c_uuid] = ('console', cfg)
target['console_refs'].append(c_uuid)
- cfg = self.console_add('vt100', '1')
- c_uuid = uuid.createString()
- target['devices'][c_uuid] = ('console', cfg)
- target['console_refs'].append(c_uuid)
-
+ i = i + 1
elif dev_type == 'console':
if 'console_refs' not in target:
target['console_refs'] = []
if dev_type == 'vfb':
if 'keymap' in dev_info:
keymap = dev_info.get('keymap',{})
+ if 'monitor' in dev_info:
+ ret.append("-serial")
+ ret.append(dev_info.get('monitor',{}))
+ ret.append("-monitor")
+ ret.append("null")
if 'serial' in dev_info:
ret.append("-serial")
ret.append(dev_info.get('serial',{}))
ret = ImageHandler.parseDeviceModelArgs(self, vmConfig)
# Equivalent to old xenconsoled behaviour. Should make
# it configurable in future
- ret = ret + ["-serial", "pty"]
+ ret = ["-serial", "pty"] + ret
return ret
def getDeviceModelArgs(self, restore = False):
if not self.display :
self.display = ''
- # Do not store sdl and opengl qemu cli options
- self.vm.storeVm(("image/dmargs", " ".join([ x for x in self.dmargs
- if x != "-sdl"
- and x != "-disable-opengl" ])),
+
+ store_dmargs = self.dmargs[:]
+ store_dmargs.remove('-sdl')
+ store_dmargs.remove('-disable-opengl')
+ try :
+ midx = store_dmargs.index('-monitor')
+ store_dmargs[midx + 1] = 'pty'
+ except ValueError :
+ pass
+ self.vm.storeVm(("image/dmargs", " ".join(store_dmargs)),
("image/device-model", self.device_model),
("image/display", self.display))
self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )
For example 'irq=7'.
This option may be repeated to add more than one IRQ.""")
-gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE,serial=FILE",
+gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE,serial=FILE,monitor=FILE",
fn=append_value, default=[],
use="""Make the domain a framebuffer backend.
Both sdl=1 and vnc=1 can be enabled at the same time.
given DISPLAY and XAUTHORITY, which default to the current user's
ones. OpenGL will be used by default unless opengl is set to 0.
keymap overrides the XendD configured default layout file.
- Serial adds a second serial support to qemu.""")
+ Serial adds a second serial support to qemu.
+ Monitor adds a backend for the stubdom monitor.""")
gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
"backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL",
for (k,v) in d.iteritems():
if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd',
- 'opengl', 'keymap', 'serial' ]:
+ 'opengl', 'keymap', 'serial', 'monitor' ]:
err("configuration option %s unknown to vfbs" % k)
config.append([k,v])
if not d.has_key("keymap"):